﻿@{
    Layout = null;
}
@model System.Data.DataTable
<!DOCTYPE html>
<html>
<head>
    <title>年度补贴金额估算查询</title>
    <link href="@Url.Content("~/Content/Site.css", true)" rel="stylesheet" type="text/css" />
    <script src="@Url.Content("~/Scripts/jquery.min.js", true)" type="text/javascript"></script>
    <script src="@Url.Content("~/Common/GetRootPath.ashx", true)" type="text/javascript"></script>
    @Html.DevExpress().GetStyleSheets(
                new StyleSheet { ExtensionType = ExtensionType.GridView, Theme = DevExpressHelper.Theme }
            )
    <script src="@Url.Content("~/Scripts/checkinput.js")" type="text/javascript"></script>
 
 <script>

     $(document).ready(function () {
         var hdjsAlert = $("#hdjsAlert").val();
         if (hdjsAlert != "") {
             alert(hdjsAlert);
         }
     });
</script>
    <script type="text/javascript">
        var rootUrl = '@Url.Content("~/QueryAllowanceForecast/")';

        function OnBeginCallback(s, e) {
            e.customArgs["command"] = e.command;

            var enterprisePropNo = $("#hFEnterprisePropNo").val();
            var taxClassAllowanceNo = $("#htaxClassAllowanceNo").val();
            var nsrsbh = $("#hnsrsbh").val();
            var nsrbm = $("#hnsrbm").val();
            var nsrmc = $("#hnsrmc").val();
            var kbje1 = $("#hkbje1").val();
            var kbje2 = $("#hkbje2").val();

            e.customArgs["FEnterprisePropNo"] = enterprisePropNo;
            e.customArgs["FTaxClassAllowanceNo"] = taxClassAllowanceNo;
            e.customArgs["nsrsbh"] = nsrsbh;
            e.customArgs["nsrbm"] = nsrbm;
            e.customArgs["nsrmc"] = nsrmc;
            e.customArgs["kbje1"] = kbje1;
            e.customArgs["kbje2"] = kbje2;

        }


        //查询
        function search() {
            if (check()) {
                $("#htaxClassAllowanceNo").val(FTaxClassAllowanceNo.GetValue());
                $("#hnsrsbh").val(Nsrsbh.GetText());
                $("#hnsrbm").val(Nsrbm.GetText());
                $("#hnsrmc").val(Nsrmc.GetText());
                $("#hkbje1").val($("#kbje1").val());
                $("#hkbje2").val($("#kbje2").val());
                $("#hFEnterprisePropNo").val(FEnterprisePropNo.GetValue())
                $("#hsearched").val("T");
                gvEditing.Refresh();
               
                //                form_query.action = rootUrl;
                //                form_query.submit();
            }
        }

        function check() {
            if (!isFloat($('#kbje1').val()) || !isFloat($('#kbje2').val())) {
                alert('请正确输入金额数！');
                return false;
            }
            return true;
        }

        function reset() {

            FEnterprisePropNo.SetValue("");
            FTaxClassAllowanceNo.SetValue("");
            Nsrsbh.SetText("");
            Nsrbm.SetText("");
            Nsrmc.SetText("");
            $("#kbje1").val("");
            $("#kbje2").val("");
        }

        function MenuTop_emClick(source, e) {
            switch (e.item.name) {
                case "btnExcel":
                    {
                        if ($("#hsearched").val() == "T") {
                            //                        form_query.action = rootUrl + 'ExportToXls';
                            form1.submit();
                        } break;
                    }
                case "btnReport":
                    {
                        if ($("#hsearched").val() == "T") {
                            window.showModalDialog(rootPath + "/QueryAllowanceForecast/Print", window, "dialogWidth=800px;dialogHeight=500px");
                        }

                        //                        //if (CheckValues())
                        //                        form_query.target = '_blank';
                        //                        //  form_query.target = 'parent.contentframe';
                        //                        //  parent.contentframe.url(
                        //                        form_query.action = rootPath + "/QueryAllowanceInfo/Print";
                        //                        form_query.submit();
                        break;


                    }

                case "btnGridShow":
                    {
                        gvEditing.ShowCustomizationWindow();
                        break;
                    }
            }
        }
        function keyPress() {
            if (event.keyCode && event.keyCode == 13) {
                search();

            }

        }
    </script>
    <style>
        #form_query
        {
            left: 5px;
            border: 1px solid #aecaf0;
            padding: 10px;
            margin: 0px;
        }
        #form_query label
        {
            padding-left: 15px;
        }
        input
        {
            border: 1px solid #aecaf0;
        }
        input.btn
        {
            padding: 2px 10px;
            border: #a3c0e8 1px solid;
            background: #e2f0ff url(/EnterpriseFund/DXR.axd?r=0_54) repeat-x 50% top;
            color: #2c4d79;
            cursor: pointer;
        }
        input.btn:hover
        {
            background-image: url(/EnterpriseFund/DXR.axd?r=0_57);
        }
        th
        {
            text-align: right;
        }
        td
        {
            padding: 0;
        }
    </style>
</head>
<body   onkeypress="keyPress()">
    @Html.Partial("LoadPanelPartial")
    @Html.DevExpress().Menu(settings =>
{
    settings.Name = "toolBarMenu";
    settings.ItemAutoWidth = false;
    settings.Width = System.Web.UI.WebControls.Unit.Percentage(100);
    settings.Styles.Style.Border.BorderWidth = System.Web.UI.WebControls.Unit.Pixel(0);
    settings.Styles.Style.BorderTop.BorderWidth = System.Web.UI.WebControls.Unit.Pixel(1);
    settings.Items.Add(item =>
    {
        item.Name = "btnExcel";
        item.Text = "导出Excel";
        item.Image.Url = Url.Content("~/Content/ControlImages/excel.png");
    });
    settings.Items.Add(item =>
    {
        item.Name = "btnReport";
        item.Text = "打印";
        item.Image.Url = Url.Content("~/Content/icons/print.png");
    });


    settings.Items.Add(item =>
    {
        item.Name = "btnGridShow";
        item.Text = "选择列";
        item.Image.Url = Url.Content("~/Content/FunctionImages/AllowanceFileAudit.png");
    });
    settings.ClientSideEvents.ItemClick = "function(source,e){MenuTop_emClick(source,e)}";
    settings.ItemLinkMode = ItemLinkMode.ContentBounds;
}).GetHtml()
    @using (Html.BeginForm("ExportToXls", "QueryAllowanceForecast", FormMethod.Post, new { id = "form1" }))
    {

        <table  class="query" width="800px" style="margin-left: auto; margin-right: auto">
            <tr>
                <td align="right" style="text-align:right">
                    企业性质：
                </td>
                <td>@Html.DevExpress().ComboBox(settings =>
           {
               settings.Name = "FEnterprisePropNo";
               settings.Properties.TextField = "FEnterprisePropName";
               settings.Properties.ValueField = "FEnterprisePropNo";
               settings.Width = 110;
           }).BindList(ViewBag.EnterpriseProps).Bind(ViewBag.FEnterprisePropNo).GetHtml()
                </td>
                <td align="right" style="text-align:right">
                    纳税人编码：
                </td>
                <td>
                    @Html.DevExpress().TextBox(settings =>
               {
                   settings.Name = "Nsrbm";
                   settings.Width = System.Web.UI.WebControls.Unit.Pixel(120);
               }).GetHtml()
                </td>
                <td align="right" style="text-align:right">
                    纳税人名称：
                </td>
                <td>
                    @Html.DevExpress().TextBox(settings =>
               {
                   settings.Name = "Nsrmc";
                   settings.Width = System.Web.UI.WebControls.Unit.Pixel(135);
               }).GetHtml()
                </td>
                <td>
                 <table>
                    <tr>
                        <td>
                            @Html.DevExpress().Button(settings =>
                           {
                               settings.Name = "btnSearch";
                               settings.Text = "查询";
                               //settings.Height = System.Web.UI.WebControls.Unit.Pixel(20);
                               //settings.Width = System.Web.UI.WebControls.Unit.Pixel(100);
                               settings.ControlStyle.CssClass = "button";
                               settings.Images.Image.Url = Url.Content("~/Content/ControlImages/search.png");
                               settings.ClientSideEvents.Click = "search";
                           }).GetHtml()
                        </td>
                        <td>
                            @Html.DevExpress().Button(settings =>
                           {
                               settings.Name = "btnUndo";
                               settings.Text = "重置";
                               //settings.Height = System.Web.UI.WebControls.Unit.Pixel(20);
                               //settings.Width = System.Web.UI.WebControls.Unit.Pixel(100);
                               settings.ControlStyle.CssClass = "button";
                               settings.Images.Image.Url = Url.Content("~/Content/ControlImages/undo_blue.png");
                               settings.ClientSideEvents.Click = "reset";
                           }).GetHtml()
                        </td>
                    </tr>
                </table>
                   @* <table>
                        <tr>
                            <td>
                                <input class="btn" type="button" onclick="search();" value="查询" />
                            </td>
                            <td>
                                <input class="btn" type="button" onclick="reset();" value="重置" />
                            </td>
                        </tr>
                    </table>*@
                </td>
            </tr>
            <tr>
                <td align="right" style="text-align:right">
                    可补贴税种：
                </td>
                <td>
                    @Html.DevExpress().ComboBox(settings =>
           {
               settings.Name = "FTaxClassAllowanceNo";
               settings.Properties.TextField = "FTaxClassAllowanceName";
               settings.Properties.ValueField = "FTaxClassAllowanceNo";
               settings.Width = 110;
           }).BindList(ViewBag.TaxClassAllowance).Bind(ViewBag.FTaxClassAllowanceNo).GetHtml()
                </td>
                <td align="right" style="text-align:right">
                    纳税人识别号：
                </td>
                <td>
                    @Html.DevExpress().TextBox(settings =>
               {
                   settings.Name = "Nsrsbh";
                   settings.Width = System.Web.UI.WebControls.Unit.Pixel(120);
               }).GetHtml()
                </td>
                <td align="right" style="text-align:right">
                    可补金额：
                </td>
                <td>
                    <table>
                        <tr>
                            <td>
                                <input id="kbje1" name="kbje1" size="5" value="@ViewBag.kbje1" />
                            </td>
                            <td>
                                -
                            </td>
                            <td>
                                <input id="kbje2" name="kbje2" size="5" value="@ViewBag.kbje2" />
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
        </table>

        @Html.Partial("AllowanceForecastPartial", Model)
        @Html.Hidden("htaxClassAllowanceNo","");
        @Html.Hidden("hnsrsbh","");
        @Html.Hidden("hnsrbm","");
        @Html.Hidden("hnsrmc","");
        @Html.Hidden("hkbje1","");
        @Html.Hidden("hkbje2","");
        @Html.Hidden("hFEnterprisePropNo", "");
          @Html.Hidden("hdjsAlert", (ViewData["jsAlert"]));
        @Html.Hidden("hsearched","F")
    }
</body>
</html>
<script>
    lp.Hide();
</script>
